package hu;

import java.util.*;

public class n_thread implements Runnable{
    public static int i = 0;
    public static int n;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n_thread nth = new n_thread();
        n = sc.nextInt();
        for(int j = 0; j < n; j++){
            new Thread(nth, "thread_" + j).start();
        }
    }

    @Override
    public void run() {
        while (true){
            synchronized (this){
                notifyAll();
                if(i >= 100)
                    break;
                int id = Integer.parseInt(Thread.currentThread().getName().substring(7));
                if(i % n == id)
                    System.out.println(Thread.currentThread().getName() + "-->" + ++i);
                try {
                    wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
